package com.rentalcar.wechat.service.impl;

import java.util.List;
import com.rentalcar.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.rentalcar.wechat.mapper.UmsCarCategoryMapper;
import com.rentalcar.wechat.domain.UmsCarCategory;
import com.rentalcar.wechat.service.IUmsCarCategoryService;

/**
 * 车辆分类Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-06-20
 */
@Service
public class UmsCarCategoryServiceImpl implements IUmsCarCategoryService 
{
    @Autowired
    private UmsCarCategoryMapper umsCarCategoryMapper;

    /**
     * 查询车辆分类
     * 
     * @param id 车辆分类主键
     * @return 车辆分类
     */
    @Override
    public UmsCarCategory selectUmsCarCategoryById(Long id)
    {
        return umsCarCategoryMapper.selectUmsCarCategoryById(id);
    }

    /**
     * 查询车辆分类列表
     * 
     * @param umsCarCategory 车辆分类
     * @return 车辆分类
     */
    @Override
    public List<UmsCarCategory> selectUmsCarCategoryList(UmsCarCategory umsCarCategory)
    {
        return umsCarCategoryMapper.selectUmsCarCategoryList(umsCarCategory);
    }

    /**
     * 新增车辆分类
     * 
     * @param umsCarCategory 车辆分类
     * @return 结果
     */
    @Override
    public int insertUmsCarCategory(UmsCarCategory umsCarCategory)
    {
        umsCarCategory.setCreateTime(DateUtils.getNowDate());
        return umsCarCategoryMapper.insertUmsCarCategory(umsCarCategory);
    }

    /**
     * 修改车辆分类
     * 
     * @param umsCarCategory 车辆分类
     * @return 结果
     */
    @Override
    public int updateUmsCarCategory(UmsCarCategory umsCarCategory)
    {
        umsCarCategory.setUpdateTime(DateUtils.getNowDate());
        return umsCarCategoryMapper.updateUmsCarCategory(umsCarCategory);
    }

    /**
     * 批量删除车辆分类
     * 
     * @param ids 需要删除的车辆分类主键
     * @return 结果
     */
    @Override
    public int deleteUmsCarCategoryByIds(Long[] ids)
    {
        return umsCarCategoryMapper.deleteUmsCarCategoryByIds(ids);
    }

    /**
     * 删除车辆分类信息
     * 
     * @param id 车辆分类主键
     * @return 结果
     */
    @Override
    public int deleteUmsCarCategoryById(Long id)
    {
        return umsCarCategoryMapper.deleteUmsCarCategoryById(id);
    }
}
